<?php
/***
 * 账单管理
*/
namespace App\Http\Controllers;

use Illuminate\Support\Facades\Input;
use App\Json\Json;
class BillController extends Controller
{
    /**账单列表
     * @id 用户id
     * @user_all_bill 用户所有账单信息
     *
     *
     *
     */
    public function bill_list()
    {
        //
        $id = Input::all()['id'];
        $user_all_bill = \DB::table('bill')->where('userid',$id)->get(); //
        if(count($user_all_bill)<1){
            $result = ['code'=>'1004','msg'=>'you have no bills'];
             return Json::json($result['code'],$result['msg']);
        }
        foreach($user_all_bill as $bills){
            $fitment = \DB::table('order_details')->where('details_order_id',$bills->orderdtid)->get();
          echo "<pre />";
        print_r($fitment);
        }


    }
}
